home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96b.txt
/
000056_icon-group-sender _Thu Nov 14 01:24:50 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1997-01-02
|
3KB
Received: by cheltenham.cs.arizona.edu; Thu, 14 Nov 1996 09:13:28 MST
To: icon-group@cs.arizona.edu
Date: 14 Nov 1996 01:24:50 GMT
From: haertel@ichips.intel.com (Mike Haertel)
Message-Id: <56dsd2$7mq@news.jf.intel.com>
Organization: Intel Corporation
Sender: icon-group-request@cs.arizona.edu
Subject: A bug fix (workaround, really) for ICONC with large integers
Errors-To: icon-group-errors@cs.arizona.edu
The Unix Icon compiler has a long-standing bug that array indexing
doesn't work when large integers are enabled. I reported this a long
time ago but nobody ever did anything about it, and I got tired of
waiting. I don't see an Icon mailing list on the web page, so here
it is...
SYMPTOM:
The following program doesn't compile with "iconc -fl foo.icn";
it gets a type error from the C compiler. (You won't see this
error unless you're using a compiler that supports prototypes,
like GCC.)
procedure main(argl)
every i := 1 to *argl do
write(argl[i])
end
PATCH:
There is a bug in Iconc's inlining of the runtime library
code that causes it to generate calls to the runtime array
indexing function with the an argument of the wrong C type.
The following patch works around the bug by changing the
runtime code. It does not address the underlying Iconc bug,
which might conceivably affect inlining other parts of the
runtime as well. I think I know where the underlying bug
is, but it's not obvious to me how to fix it and I just want
to get some work done...
CAVEATS:
After applying this patch you'll have to rebuild rt.a and
rt.db. As usual where random patches from strangers are
concerned, your milage may vary. :-)
--- dist/src/runtime/oref.r Thu Sep 28 10:46:45 1995
+++ src/runtime/oref.r Tue Nov 12 23:32:46 1996
@@ -560,10 +560,10 @@
runerr(101, i)
}
- if !cnv:C_integer(j) then {
+ else if !cnv:C_integer(j) then {
if cnv : integer(j) then inline { fail; }
runerr(101, j)
}
- body {
+ else body {
C_integer t;
@@ -613,10 +613,10 @@
runerr(101, i)
}
- if !cnv:C_integer(j) then {
+ else if !cnv:C_integer(j) then {
if cnv : integer(j) then inline { fail; }
runerr(101, j)
}
- body {
+ else body {
C_integer t;
@@ -667,5 +667,5 @@
runerr(101, y)
}
- body {
+ else body {
word i, j;
register union block *bp; /* doesn't need to be tended */
@@ -825,5 +825,5 @@
}
- body {
+ else body {
char ch;
word i;